typescript-ts-mode: Improve function body indentation (bug#78121)
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Tue, 29 Apr 2025 14:51:18 +0000 (21:51 +0700)
committerYuan Fu <casouri@gmail.com>
Mon, 26 May 2025 03:50:41 +0000 (20:50 -0700)
commit1d2ae31b8bcca5f00c3c707cc7af3a347749c332
tree720ffb58f6dab48344155f336cf29a31da6f7794
parent421ecbcf6b476c413675e93c074f1399db146fc8
typescript-ts-mode: Improve function body indentation (bug#78121)

Older code was calculating body indentation depending on function
parameters alignment.  This is incorrect, because if parameters are
misaligned, so will the function body.  Instead, use offset of the
previous standalone parent.

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): Stop depending on function
parameters indentation for calculating body content and the closing
`}'.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
(Function body with params misindented (bug#78121)): Add new test.
lisp/progmodes/typescript-ts-mode.el
test/lisp/progmodes/typescript-ts-mode-resources/indent.erts